package com.zhu.fastFoodRestaurantOrderSystem.exception;

public class BusinessException extends RuntimeException{
    private final String errorCode;

    // 完整构造方法
    public BusinessException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode.getCode();
    }

    public String getErrorCode() {
        return errorCode;
    }
}
